package UI.Main;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Calendar;

/**
 * @author 杨明政
 * @version  2021.0520
 * @since 1.8
 */

/**
 * 主窗口类.
 * For example:
 * <pre>
 * Frame f=new Frame();
 * </pre>
 * @author 杨明政
 * @see javax.swing.JFrame
 * @see javax.swing.RootPaneContainer
 * @see javax.swing.TransferHandler
 * @see javax.swing.WindowConstants
 */

public class Frame extends JFrame{
    public static Frame _instance;
    public static CardLayout pages;
    public static JPanel mainPanel;
    JButton firstPagebtn;
    
    /**
     *
     */
    public Frame(){
        //设置窗口属性
        this._instance=this;
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setResizable(false);
        this.setVisible(true);
        this.setBounds(500, 500, 1410, 900);
        this.setLayout(null);
        this.setTitle("文件管理系统");
        //设置主窗口切换内容
        pages = new CardLayout() ;
        UserPage pageUser=new UserPage();
        MainForm pageMain=new MainForm();
        SearchPage pageSearch=new SearchPage();
        mainPanel =new JPanel();
        mainPanel.setLayout(pages);
        this.add(pageUser);
        mainPanel.add(pageMain);
        mainPanel.add(pageSearch);
        pageUser.setBounds(0,0,200,900);
        mainPanel.setBounds(200,0, 1210, 900);
        this.add(mainPanel);
        firstPagebtn =new JButton("mainpage");
        pages.first(mainPanel);
        
    }

    public static void main(String[] args) {
        Frame window=new Frame();
    }
}
